﻿using System;
using System.Text;

namespace SwissTransTracker
{
    /// <summary>
    ///     See transport.opendata.ch
    /// </summary>
    public class Prognosis
    {
        /// <summary>
        ///     The estimated arrival/departure platform
        /// </summary>
        public int? Platform { get; set; }

        /// <summary>
        ///     The departure time prognosis to the checkpoint
        ///     Date format: ISO 8601
        /// </summary>
        public DateTime? Departure { get; set; }

        /// <summary>
        ///     The arrival time prognosis to the checkpoint
        ///     Date format: ISO 8601
        /// </summary>
        public DateTime? Arrival { get; set; }

        /// <summary>
        ///     The estimated occupation load of 1st class coaches
        /// </summary>
        public int? Capacity1St { get; set; }

        /// <summary>
        ///     The estimated occupation load of 2nd class coaches
        /// </summary>
        public int? Capacity2St { get; set; }

        public override string ToString()
        {
            var sb = new StringBuilder();
            if (this.Platform != null) sb.AppendFormat("Platform: {0}{1}", this.Platform, Environment.NewLine);
            if (this.Arrival != null) sb.AppendFormat("Arrival: {0}{1}", this.Arrival, Environment.NewLine);
            if (this.Departure != null) sb.AppendFormat("Departure: {0}{1}", this.Departure, Environment.NewLine);
            if (this.Capacity1St != null) sb.AppendFormat("Capacity1St: {0}{1}", this.Capacity1St, Environment.NewLine);
            if (this.Capacity2St != null) sb.AppendFormat("Capacity2St: {0}{1}", this.Capacity2St, Environment.NewLine);
            return sb.ToString();
        }
    }
}